<extend name="Public/layout"/>
<block name="style" >
    <link rel="stylesheet" type="text/css" href="__LYUI__/css/lyui.extend.min.css">
    <link rel="stylesheet" type="text/css" href="__ADMIN_CSS__/style.css">
</block>

<block name="main">
   <div id="main" class="col-xs-12 col-sm-9 main" style="overflow-y: scroll;">
        <!-- 面包屑导航 -->
        <ul class="breadcrumb">
            <li><i class="fa fa-map-marker"></i></li>
            <foreach name="_menu_tab['name']" item="tab_v" >
            <li class="text-muted">{$tab_v}</li>
            </foreach>
        </ul>

        <!-- 主体内容区域 -->
        <div class="tab-content ct-tab-content">
            <div class="panel-body">
                <div class="builder formbuilder-box">
                        <div class="builder-tabs builder-form-tabs">
	                        <ul class="nav nav-tabs">
	                             <li class="active">
	                                <a href="{:U('Database/index')}">备份数据</a>
	                            </li>
	                            <li >
	                                <a href="{:U('Database/import')}">还原数据</a>
	                            </li>
	                        </ul>
	                    </div>
                        <div class="form-group"></div>

                        <!-- 顶部工具栏按钮 -->
                        <div class="builder-toolbar">
                            <div class="row">
                                <!-- 工具栏按钮 -->
                                    <div class="col-xs-12 col-sm-8 button-list clearfix">
                                        <div class="form-group">
                                            <a title="备份数据库" class="btn btn-primary-outline btn-pill ajax-post confirm" target-form="tables" model="Database" href="{:U('export')}">备份数据库</a>&nbsp;
                                            <a title="优化" target-form="tables" class="btn btn-success-outline btn-pill ajax-post confirm" model="Database" href="{:U('optimize')}">优化</a>&nbsp;
                                            <a title="修复" target-form="tables" class="btn btn-warning-outline btn-pill ajax-post confirm" model="Database" href="{:U('repair')}">修复</a>&nbsp;

                                            <a title="清空数据"   class="btn btn-warning-outline btn-pill " model="Database" href="##" onclick="document.getElementById('pwdshow').style.display='block';">清空数据</a>&nbsp;


                                            <div id="pwdshow" style="display: none;margin:20px 0px;">
                                           <form action="{:U('qingkong')}" method="post" class="form-horizontal form form-builder form-builderf" style="margin-bottom:0px">

                                            输入密码: <input type="password" name="pwd">
                                            <a style="margin-left:10px;" class="btn btn-primary submit ajax-post"  type="submit" target-form="form-builderf">提交</a>
                                    <a class="btn btn-danger return" onclick="document.getElementById('pwdshow').style.display='none';return false;">取消</a>

                                           </form>


                                            </div>
                                        </div>
                                    </div>
                            </div>
                        </div>
                        
                        <!-- 数据列表 -->
                        <div class="builder-container">
                            <div class="row">
                                <div class="col-xs-12">
                                    <div class="builder-table">
                                        <div class="panel panel-default table-responsive">
                                            <table class="table table-bordered table-striped table-hover">
                                              <thead>
                                                <tr>
                                                    <th>
                                                        <input class="check-all" type="checkbox">
                                                    </th>
                                                    <th>表名</th>
                                                    <th>数据量</th>
                                                    <th>数据大小</th>
                                                    <th>创建时间</th>
                                                    <th>操作</th>
                                                </tr>
                                            </thead>
                                                <tbody>
                                                    <volist name="list" id="data">
                                                        <tr>
                                                            <td>
                                                                <input class="tables" type="checkbox" value="{$data['name']}" name="tables[]">
                                                            </td>
                                                            <td>{$data['name']}</td>
                                                            <td>{$data['rows']}</td>
                                                            <td>{$data['data_length']|byte_Format}</td>
                                                            <td>{$data['create_time']}</td>
                                                            <td>
                                                               
                                                                <a name="edit" title="优化表" class="label label-primary-outline label-pill ajax-get confirm" href="{:U('optimize',array('tables'=>$data['name']))}">优化表</a>

                                 
                                                                <a name="forbid" title="修复表" class="label label-success-outline label-pill ajax-get confirm" href="{:U('repair',array('tables'=>$data['name']))}">修复表</a>
                                                        </tr>
                                                    </volist>

                                                    <empty name="list">
                                                        <tr class="builder-data-empty">
                                                            <td class="text-center empty-info" colspan="20">
                                                                <i class="fa fa-database"></i> 暂时没有数据<br>
                                                            </td>
                                                        </tr>
                                                    </empty>
                                                </tbody>
                                            </table>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>

                </div>
            </div>
    </div>                   
</div>
</block>
<block name="script">
    <script type="text/javascript" src="__LYUI__/js/lyui.extend.min.js"></script>
</block>